package com.zf.shuashua.base;

import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import static com.umeng.socialize.utils.ContextUtil.getPackageName;


public abstract class BaseFragment extends com.meis.base.mei.base.BaseFragment {
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View rootView = initView(inflater, container);
        initViewModel();
        initView(rootView);
        return rootView;
    }

    @Override
    protected void initData() {
    }

    @Override
    protected void initView() {
    }

    protected abstract void initView(View rootView);

    protected abstract void initViewModel();

    private View initView(LayoutInflater inflater, ViewGroup container) {
        View root = inflater.inflate(getLayoutId(), container, false);
        return root;
    }

    @LayoutRes
    protected abstract int getLayoutId();

}
